extends TechnologyResource
class_name AllySoldierArmor

var defense_increase = 0.25
var speed_decrease   = 0.1


func _init() -> void:
	super()
	display_name = "Soldier Armor"
	description = """Increases soldier defense by 25%, decrease speed by 10%"""
	GlobalSignal.gs_unit_created.connect(_on_unit_create)


func _on_unit_create(unit: Unit):
	if unit is AllySoldier:
		unit.defense_value = floorf(unit.defense_value * (1.0 + defense_increase))
		unit.speed = floorf(unit.speed * (1.0 - speed_decrease))
